package QQCharting;

import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.util.Scanner;

public class QQRoom {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        System.out.print("请输入聊天服务当前启动窗口号：");
        int server = input.nextInt();
        System.out.print("请输入聊天服务发送信息对象的目标窗口号：");
        int receiver = input.nextInt();
        System.out.println("聊天系统初始化完成并启动！");
        try{
            DatagramSocket socket = new DatagramSocket(server);
            new Thread(new Receiver(socket),"接收信息").start();
            new Thread(new Sender(receiver,socket),"发送信息").start();


        } catch(Exception e){
            e.printStackTrace();
        }
    }

}
